3.1.100 \(\int (-a+b \cot (c+d x)) \sqrt {a+b \cot (c+d x)} \, dx\) [100]

Optimal. Leaf size=422 \[ \frac {b \sqrt {a^2+b^2} \tanh ^{-1}\left (\frac {\sqrt {a+\sqrt {a^2+b^2}}-\sqrt {2} \sqrt {a+b \cot (c+d x)}}{\sqrt {a-\sqrt {a^2+b^2}}}\right )}{\sqrt {2} \sqrt {a-\sqrt {a^2+b^2}} d}-\frac {b \sqrt {a^2+b^2} \tanh ^{-1}\left (\frac {\sqrt {a+\sqrt {a^2+b^2}}+\sqrt {2} \sqrt {a+b \cot (c+d x)}}{\sqrt {a-\sqrt {a^2+b^2}}}\right )}{\sqrt {2} \sqrt {a-\sqrt {a^2+b^2}} d}-\frac {2 b \sqrt {a+b \cot (c+d x)}}{d}-\frac {b \sqrt {a^2+b^2} \log \left (a+\sqrt {a^2+b^2}+b \cot (c+d x)-\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} \sqrt {a+b \cot (c+d x)}\right )}{2 \sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} d}+\frac {b \sqrt {a^2+b^2} \log \left (a+\sqrt {a^2+b^2}+b \cot (c+d x)+\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} \sqrt {a+b \cot (c+d x)}\right )}{2 \sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} d} \]

[Out]

-2*b*(a+b*cot(d*x+c))^(1/2)/d+1/2*b*arctanh((-2^(1/2)*(a+b*cot(d*x+c))^(1/2)+(a+(a^2+b^2)^(1/2))^(1/2))/(a-(a^
2+b^2)^(1/2))^(1/2))*(a^2+b^2)^(1/2)/d*2^(1/2)/(a-(a^2+b^2)^(1/2))^(1/2)-1/2*b*arctanh((2^(1/2)*(a+b*cot(d*x+c
))^(1/2)+(a+(a^2+b^2)^(1/2))^(1/2))/(a-(a^2+b^2)^(1/2))^(1/2))*(a^2+b^2)^(1/2)/d*2^(1/2)/(a-(a^2+b^2)^(1/2))^(
1/2)-1/4*b*ln(a+b*cot(d*x+c)+(a^2+b^2)^(1/2)-2^(1/2)*(a+b*cot(d*x+c))^(1/2)*(a+(a^2+b^2)^(1/2))^(1/2))*(a^2+b^
2)^(1/2)/d*2^(1/2)/(a+(a^2+b^2)^(1/2))^(1/2)+1/4*b*ln(a+b*cot(d*x+c)+(a^2+b^2)^(1/2)+2^(1/2)*(a+b*cot(d*x+c))^
(1/2)*(a+(a^2+b^2)^(1/2))^(1/2))*(a^2+b^2)^(1/2)/d*2^(1/2)/(a+(a^2+b^2)^(1/2))^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.35, antiderivative size = 422, normalized size of antiderivative = 1.00, number of steps used = 13, number of rules used = 9, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {3609, 12, 3566, 722, 1108, 648, 632, 212, 642} \begin {gather*} -\frac {b \sqrt {a^2+b^2} \log \left (-\sqrt {2} \sqrt {\sqrt {a^2+b^2}+a} \sqrt {a+b \cot (c+d x)}+\sqrt {a^2+b^2}+a+b \cot (c+d x)\right )}{2 \sqrt {2} d \sqrt {\sqrt {a^2+b^2}+a}}+\frac {b \sqrt {a^2+b^2} \log \left (\sqrt {2} \sqrt {\sqrt {a^2+b^2}+a} \sqrt {a+b \cot (c+d x)}+\sqrt {a^2+b^2}+a+b \cot (c+d x)\right )}{2 \sqrt {2} d \sqrt {\sqrt {a^2+b^2}+a}}+\frac {b \sqrt {a^2+b^2} \tanh ^{-1}\left (\frac {\sqrt {\sqrt {a^2+b^2}+a}-\sqrt {2} \sqrt {a+b \cot (c+d x)}}{\sqrt {a-\sqrt {a^2+b^2}}}\right )}{\sqrt {2} d \sqrt {a-\sqrt {a^2+b^2}}}-\frac {b \sqrt {a^2+b^2} \tanh ^{-1}\left (\frac {\sqrt {\sqrt {a^2+b^2}+a}+\sqrt {2} \sqrt {a+b \cot (c+d x)}}{\sqrt {a-\sqrt {a^2+b^2}}}\right )}{\sqrt {2} d \sqrt {a-\sqrt {a^2+b^2}}}-\frac {2 b \sqrt {a+b \cot (c+d x)}}{d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(-a + b*Cot[c + d*x])*Sqrt[a + b*Cot[c + d*x]],x]

[Out]

(b*Sqrt[a^2 + b^2]*ArcTanh[(Sqrt[a + Sqrt[a^2 + b^2]] - Sqrt[2]*Sqrt[a + b*Cot[c + d*x]])/Sqrt[a - Sqrt[a^2 +
b^2]]])/(Sqrt[2]*Sqrt[a - Sqrt[a^2 + b^2]]*d) - (b*Sqrt[a^2 + b^2]*ArcTanh[(Sqrt[a + Sqrt[a^2 + b^2]] + Sqrt[2
]*Sqrt[a + b*Cot[c + d*x]])/Sqrt[a - Sqrt[a^2 + b^2]]])/(Sqrt[2]*Sqrt[a - Sqrt[a^2 + b^2]]*d) - (2*b*Sqrt[a +
b*Cot[c + d*x]])/d - (b*Sqrt[a^2 + b^2]*Log[a + Sqrt[a^2 + b^2] + b*Cot[c + d*x] - Sqrt[2]*Sqrt[a + Sqrt[a^2 +
 b^2]]*Sqrt[a + b*Cot[c + d*x]]])/(2*Sqrt[2]*Sqrt[a + Sqrt[a^2 + b^2]]*d) + (b*Sqrt[a^2 + b^2]*Log[a + Sqrt[a^
2 + b^2] + b*Cot[c + d*x] + Sqrt[2]*Sqrt[a + Sqrt[a^2 + b^2]]*Sqrt[a + b*Cot[c + d*x]]])/(2*Sqrt[2]*Sqrt[a + S
qrt[a^2 + b^2]]*d)

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 632

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Dist[-2, Subst[Int[1/Simp[b^2 - 4*a*c - x^2, x], x]
, x, b + 2*c*x], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 642

Int[((d_) + (e_.)*(x_))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Simp[d*(Log[RemoveContent[a + b*x +
c*x^2, x]]/b), x] /; FreeQ[{a, b, c, d, e}, x] && EqQ[2*c*d - b*e, 0]

Rule 648

Int[((d_.) + (e_.)*(x_))/((a_) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Dist[(2*c*d - b*e)/(2*c), Int[1/(a +
 b*x + c*x^2), x], x] + Dist[e/(2*c), Int[(b + 2*c*x)/(a + b*x + c*x^2), x], x] /; FreeQ[{a, b, c, d, e}, x] &
& NeQ[2*c*d - b*e, 0] && NeQ[b^2 - 4*a*c, 0] &&  !NiceSqrtQ[b^2 - 4*a*c]

Rule 722

Int[1/(Sqrt[(d_) + (e_.)*(x_)]*((a_) + (c_.)*(x_)^2)), x_Symbol] :> Dist[2*e, Subst[Int[1/(c*d^2 + a*e^2 - 2*c
*d*x^2 + c*x^4), x], x, Sqrt[d + e*x]], x] /; FreeQ[{a, c, d, e}, x] && NeQ[c*d^2 + a*e^2, 0]

Rule 1108

Int[((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4)^(-1), x_Symbol] :> With[{q = Rt[a/c, 2]}, With[{r = Rt[2*q - b/c, 2]}
, Dist[1/(2*c*q*r), Int[(r - x)/(q - r*x + x^2), x], x] + Dist[1/(2*c*q*r), Int[(r + x)/(q + r*x + x^2), x], x
]]] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0] && NegQ[b^2 - 4*a*c]

Rule 3566

Int[((a_) + (b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Dist[b/d, Subst[Int[(a + x)^n/(b^2 + x^2), x], x
, b*Tan[c + d*x]], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[a^2 + b^2, 0]

Rule 3609

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[d*
((a + b*Tan[e + f*x])^m/(f*m)), x] + Int[(a + b*Tan[e + f*x])^(m - 1)*Simp[a*c - b*d + (b*c + a*d)*Tan[e + f*x
], x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && GtQ[m, 0]

Rubi steps

\begin {align*} \int (-a+b \cot (c+d x)) \sqrt {a+b \cot (c+d x)} \, dx &=-\frac {2 b \sqrt {a+b \cot (c+d x)}}{d}+\int \frac {-a^2-b^2}{\sqrt {a+b \cot (c+d x)}} \, dx\\ &=-\frac {2 b \sqrt {a+b \cot (c+d x)}}{d}+\left (-a^2-b^2\right ) \int \frac {1}{\sqrt {a+b \cot (c+d x)}} \, dx\\ &=-\frac {2 b \sqrt {a+b \cot (c+d x)}}{d}+\frac {\left (b \left (a^2+b^2\right )\right ) \text {Subst}\left (\int \frac {1}{\sqrt {a+x} \left (b^2+x^2\right )} \, dx,x,b \cot (c+d x)\right )}{d}\\ &=-\frac {2 b \sqrt {a+b \cot (c+d x)}}{d}+\frac {\left (2 b \left (a^2+b^2\right )\right ) \text {Subst}\left (\int \frac {1}{a^2+b^2-2 a x^2+x^4} \, dx,x,\sqrt {a+b \cot (c+d x)}\right )}{d}\\ &=-\frac {2 b \sqrt {a+b \cot (c+d x)}}{d}+\frac {\left (b \sqrt {a^2+b^2}\right ) \text {Subst}\left (\int \frac {\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}}-x}{\sqrt {a^2+b^2}-\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} x+x^2} \, dx,x,\sqrt {a+b \cot (c+d x)}\right )}{\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} d}+\frac {\left (b \sqrt {a^2+b^2}\right ) \text {Subst}\left (\int \frac {\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}}+x}{\sqrt {a^2+b^2}+\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} x+x^2} \, dx,x,\sqrt {a+b \cot (c+d x)}\right )}{\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} d}\\ &=-\frac {2 b \sqrt {a+b \cot (c+d x)}}{d}+\frac {\left (b \sqrt {a^2+b^2}\right ) \text {Subst}\left (\int \frac {1}{\sqrt {a^2+b^2}-\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} x+x^2} \, dx,x,\sqrt {a+b \cot (c+d x)}\right )}{2 d}+\frac {\left (b \sqrt {a^2+b^2}\right ) \text {Subst}\left (\int \frac {1}{\sqrt {a^2+b^2}+\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} x+x^2} \, dx,x,\sqrt {a+b \cot (c+d x)}\right )}{2 d}-\frac {\left (b \sqrt {a^2+b^2}\right ) \text {Subst}\left (\int \frac {-\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}}+2 x}{\sqrt {a^2+b^2}-\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} x+x^2} \, dx,x,\sqrt {a+b \cot (c+d x)}\right )}{2 \sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} d}+\frac {\left (b \sqrt {a^2+b^2}\right ) \text {Subst}\left (\int \frac {\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}}+2 x}{\sqrt {a^2+b^2}+\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} x+x^2} \, dx,x,\sqrt {a+b \cot (c+d x)}\right )}{2 \sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} d}\\ &=-\frac {2 b \sqrt {a+b \cot (c+d x)}}{d}-\frac {b \sqrt {a^2+b^2} \log \left (a+\sqrt {a^2+b^2}+b \cot (c+d x)-\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} \sqrt {a+b \cot (c+d x)}\right )}{2 \sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} d}+\frac {b \sqrt {a^2+b^2} \log \left (a+\sqrt {a^2+b^2}+b \cot (c+d x)+\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} \sqrt {a+b \cot (c+d x)}\right )}{2 \sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} d}-\frac {\left (b \sqrt {a^2+b^2}\right ) \text {Subst}\left (\int \frac {1}{2 \left (a-\sqrt {a^2+b^2}\right )-x^2} \, dx,x,-\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}}+2 \sqrt {a+b \cot (c+d x)}\right )}{d}-\frac {\left (b \sqrt {a^2+b^2}\right ) \text {Subst}\left (\int \frac {1}{2 \left (a-\sqrt {a^2+b^2}\right )-x^2} \, dx,x,\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}}+2 \sqrt {a+b \cot (c+d x)}\right )}{d}\\ &=\frac {b \sqrt {a^2+b^2} \tanh ^{-1}\left (\frac {\sqrt {a+\sqrt {a^2+b^2}}-\sqrt {2} \sqrt {a+b \cot (c+d x)}}{\sqrt {a-\sqrt {a^2+b^2}}}\right )}{\sqrt {2} \sqrt {a-\sqrt {a^2+b^2}} d}-\frac {b \sqrt {a^2+b^2} \tanh ^{-1}\left (\frac {\sqrt {a+\sqrt {a^2+b^2}}+\sqrt {2} \sqrt {a+b \cot (c+d x)}}{\sqrt {a-\sqrt {a^2+b^2}}}\right )}{\sqrt {2} \sqrt {a-\sqrt {a^2+b^2}} d}-\frac {2 b \sqrt {a+b \cot (c+d x)}}{d}-\frac {b \sqrt {a^2+b^2} \log \left (a+\sqrt {a^2+b^2}+b \cot (c+d x)-\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} \sqrt {a+b \cot (c+d x)}\right )}{2 \sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} d}+\frac {b \sqrt {a^2+b^2} \log \left (a+\sqrt {a^2+b^2}+b \cot (c+d x)+\sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} \sqrt {a+b \cot (c+d x)}\right )}{2 \sqrt {2} \sqrt {a+\sqrt {a^2+b^2}} d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [C] Result contains complex when optimal does not.
time = 1.07, size = 158, normalized size = 0.37 \begin {gather*} \frac {(-a+b \cot (c+d x)) \left (\frac {i \left (a^2+b^2\right ) \tanh ^{-1}\left (\frac {\sqrt {a+b \cot (c+d x)}}{\sqrt {a-i b}}\right )}{\sqrt {a-i b}}-\frac {i \left (a^2+b^2\right ) \tanh ^{-1}\left (\frac {\sqrt {a+b \cot (c+d x)}}{\sqrt {a+i b}}\right )}{\sqrt {a+i b}}+2 b \sqrt {a+b \cot (c+d x)}\right ) \sin (c+d x)}{d (-b \cos (c+d x)+a \sin (c+d x))} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(-a + b*Cot[c + d*x])*Sqrt[a + b*Cot[c + d*x]],x]

[Out]

((-a + b*Cot[c + d*x])*((I*(a^2 + b^2)*ArcTanh[Sqrt[a + b*Cot[c + d*x]]/Sqrt[a - I*b]])/Sqrt[a - I*b] - (I*(a^
2 + b^2)*ArcTanh[Sqrt[a + b*Cot[c + d*x]]/Sqrt[a + I*b]])/Sqrt[a + I*b] + 2*b*Sqrt[a + b*Cot[c + d*x]])*Sin[c
+ d*x])/(d*(-(b*Cos[c + d*x]) + a*Sin[c + d*x]))

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(801\) vs. \(2(341)=682\).
time = 0.64, size = 802, normalized size = 1.90

method result size
derivativedivides \(-\frac {2 b \left (\sqrt {a +b \cot \left (d x +c \right )}+\left (-a^{2}-b^{2}\right ) \left (\frac {-\frac {\left (\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, a^{2}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, b^{2}-\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a^{3}-\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a \,b^{2}\right ) \ln \left (\sqrt {a +b \cot \left (d x +c \right )}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}-b \cot \left (d x +c \right )-a -\sqrt {a^{2}+b^{2}}\right )}{2}+\frac {2 \left (-2 a^{2} b^{2}-2 b^{4}+\frac {\left (\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, a^{2}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, b^{2}-\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a^{3}-\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a \,b^{2}\right ) \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{2}\right ) \arctan \left (\frac {\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}-2 \sqrt {a +b \cot \left (d x +c \right )}}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\right )}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}}{4 b^{2} \left (a^{2}+b^{2}\right )^{\frac {3}{2}}}+\frac {\frac {\left (\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, a^{2}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, b^{2}-\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a^{3}-\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a \,b^{2}\right ) \ln \left (b \cot \left (d x +c \right )+a +\sqrt {a +b \cot \left (d x +c \right )}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}+\sqrt {a^{2}+b^{2}}\right )}{2}+\frac {2 \left (2 a^{2} b^{2}+2 b^{4}-\frac {\left (\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, a^{2}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, b^{2}-\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a^{3}-\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a \,b^{2}\right ) \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{2}\right ) \arctan \left (\frac {2 \sqrt {a +b \cot \left (d x +c \right )}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\right )}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}}{4 b^{2} \left (a^{2}+b^{2}\right )^{\frac {3}{2}}}\right )\right )}{d}\) \(802\)
default \(-\frac {2 b \left (\sqrt {a +b \cot \left (d x +c \right )}+\left (-a^{2}-b^{2}\right ) \left (\frac {-\frac {\left (\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, a^{2}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, b^{2}-\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a^{3}-\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a \,b^{2}\right ) \ln \left (\sqrt {a +b \cot \left (d x +c \right )}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}-b \cot \left (d x +c \right )-a -\sqrt {a^{2}+b^{2}}\right )}{2}+\frac {2 \left (-2 a^{2} b^{2}-2 b^{4}+\frac {\left (\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, a^{2}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, b^{2}-\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a^{3}-\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a \,b^{2}\right ) \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{2}\right ) \arctan \left (\frac {\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}-2 \sqrt {a +b \cot \left (d x +c \right )}}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\right )}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}}{4 b^{2} \left (a^{2}+b^{2}\right )^{\frac {3}{2}}}+\frac {\frac {\left (\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, a^{2}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, b^{2}-\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a^{3}-\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a \,b^{2}\right ) \ln \left (b \cot \left (d x +c \right )+a +\sqrt {a +b \cot \left (d x +c \right )}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}+\sqrt {a^{2}+b^{2}}\right )}{2}+\frac {2 \left (2 a^{2} b^{2}+2 b^{4}-\frac {\left (\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, a^{2}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, b^{2}-\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a^{3}-\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a \,b^{2}\right ) \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{2}\right ) \arctan \left (\frac {2 \sqrt {a +b \cot \left (d x +c \right )}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\right )}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}}{4 b^{2} \left (a^{2}+b^{2}\right )^{\frac {3}{2}}}\right )\right )}{d}\) \(802\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((-a+b*cot(d*x+c))*(a+b*cot(d*x+c))^(1/2),x,method=_RETURNVERBOSE)

[Out]

-2/d*b*((a+b*cot(d*x+c))^(1/2)+(-a^2-b^2)*(1/4/b^2/(a^2+b^2)^(3/2)*(-1/2*((2*(a^2+b^2)^(1/2)+2*a)^(1/2)*(a^2+b
^2)^(1/2)*a^2+(2*(a^2+b^2)^(1/2)+2*a)^(1/2)*(a^2+b^2)^(1/2)*b^2-(2*(a^2+b^2)^(1/2)+2*a)^(1/2)*a^3-(2*(a^2+b^2)
^(1/2)+2*a)^(1/2)*a*b^2)*ln((a+b*cot(d*x+c))^(1/2)*(2*(a^2+b^2)^(1/2)+2*a)^(1/2)-b*cot(d*x+c)-a-(a^2+b^2)^(1/2
))+2*(-2*a^2*b^2-2*b^4+1/2*((2*(a^2+b^2)^(1/2)+2*a)^(1/2)*(a^2+b^2)^(1/2)*a^2+(2*(a^2+b^2)^(1/2)+2*a)^(1/2)*(a
^2+b^2)^(1/2)*b^2-(2*(a^2+b^2)^(1/2)+2*a)^(1/2)*a^3-(2*(a^2+b^2)^(1/2)+2*a)^(1/2)*a*b^2)*(2*(a^2+b^2)^(1/2)+2*
a)^(1/2))/(2*(a^2+b^2)^(1/2)-2*a)^(1/2)*arctan(((2*(a^2+b^2)^(1/2)+2*a)^(1/2)-2*(a+b*cot(d*x+c))^(1/2))/(2*(a^
2+b^2)^(1/2)-2*a)^(1/2)))+1/4/b^2/(a^2+b^2)^(3/2)*(1/2*((2*(a^2+b^2)^(1/2)+2*a)^(1/2)*(a^2+b^2)^(1/2)*a^2+(2*(
a^2+b^2)^(1/2)+2*a)^(1/2)*(a^2+b^2)^(1/2)*b^2-(2*(a^2+b^2)^(1/2)+2*a)^(1/2)*a^3-(2*(a^2+b^2)^(1/2)+2*a)^(1/2)*
a*b^2)*ln(b*cot(d*x+c)+a+(a+b*cot(d*x+c))^(1/2)*(2*(a^2+b^2)^(1/2)+2*a)^(1/2)+(a^2+b^2)^(1/2))+2*(2*a^2*b^2+2*
b^4-1/2*((2*(a^2+b^2)^(1/2)+2*a)^(1/2)*(a^2+b^2)^(1/2)*a^2+(2*(a^2+b^2)^(1/2)+2*a)^(1/2)*(a^2+b^2)^(1/2)*b^2-(
2*(a^2+b^2)^(1/2)+2*a)^(1/2)*a^3-(2*(a^2+b^2)^(1/2)+2*a)^(1/2)*a*b^2)*(2*(a^2+b^2)^(1/2)+2*a)^(1/2))/(2*(a^2+b
^2)^(1/2)-2*a)^(1/2)*arctan((2*(a+b*cot(d*x+c))^(1/2)+(2*(a^2+b^2)^(1/2)+2*a)^(1/2))/(2*(a^2+b^2)^(1/2)-2*a)^(
1/2)))))

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-a+b*cot(d*x+c))*(a+b*cot(d*x+c))^(1/2),x, algorithm="maxima")

[Out]

integrate(sqrt(b*cot(d*x + c) + a)*(b*cot(d*x + c) - a), x)

________________________________________________________________________________________

Fricas [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-a+b*cot(d*x+c))*(a+b*cot(d*x+c))^(1/2),x, algorithm="fricas")

[Out]

Timed out

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} - \int a \sqrt {a + b \cot {\left (c + d x \right )}}\, dx - \int \left (- b \sqrt {a + b \cot {\left (c + d x \right )}} \cot {\left (c + d x \right )}\right )\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-a+b*cot(d*x+c))*(a+b*cot(d*x+c))**(1/2),x)

[Out]

-Integral(a*sqrt(a + b*cot(c + d*x)), x) - Integral(-b*sqrt(a + b*cot(c + d*x))*cot(c + d*x), x)

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-a+b*cot(d*x+c))*(a+b*cot(d*x+c))^(1/2),x, algorithm="giac")

[Out]

integrate(sqrt(b*cot(d*x + c) + a)*(b*cot(d*x + c) - a), x)

________________________________________________________________________________________

Mupad [B]
time = 2.57, size = 583, normalized size = 1.38 \begin {gather*} -\mathrm {atanh}\left (\frac {d^3\,\left (\frac {16\,\left (a^2\,b^4-a^4\,b^2\right )\,\sqrt {a+b\,\mathrm {cot}\left (c+d\,x\right )}}{d^2}+\frac {16\,a\,b^2\,\left (a^3+1{}\mathrm {i}\,b\,a^2\right )\,\sqrt {a+b\,\mathrm {cot}\left (c+d\,x\right )}}{d^2}\right )\,\sqrt {-\frac {a^3+1{}\mathrm {i}\,b\,a^2}{d^2}}}{16\,\left (a^5\,b^3+a^3\,b^5\right )}\right )\,\sqrt {-\frac {a^3+1{}\mathrm {i}\,b\,a^2}{d^2}}-\mathrm {atanh}\left (\frac {d^3\,\sqrt {\frac {-a^3+a^2\,b\,1{}\mathrm {i}}{d^2}}\,\left (\frac {16\,\left (a^2\,b^4-a^4\,b^2\right )\,\sqrt {a+b\,\mathrm {cot}\left (c+d\,x\right )}}{d^2}-\frac {16\,a\,b^2\,\left (-a^3+a^2\,b\,1{}\mathrm {i}\right )\,\sqrt {a+b\,\mathrm {cot}\left (c+d\,x\right )}}{d^2}\right )}{16\,\left (a^5\,b^3+a^3\,b^5\right )}\right )\,\sqrt {\frac {-a^3+a^2\,b\,1{}\mathrm {i}}{d^2}}-\frac {2\,b\,\sqrt {a+b\,\mathrm {cot}\left (c+d\,x\right )}}{d}+\mathrm {atan}\left (\frac {b^6\,\sqrt {\frac {a\,b^2}{4\,d^2}-\frac {b^3\,1{}\mathrm {i}}{4\,d^2}}\,\sqrt {a+b\,\mathrm {cot}\left (c+d\,x\right )}\,32{}\mathrm {i}}{\frac {b^8\,16{}\mathrm {i}}{d}+\frac {a^2\,b^6\,16{}\mathrm {i}}{d}}+\frac {32\,a\,b^5\,\sqrt {\frac {a\,b^2}{4\,d^2}-\frac {b^3\,1{}\mathrm {i}}{4\,d^2}}\,\sqrt {a+b\,\mathrm {cot}\left (c+d\,x\right )}}{\frac {b^8\,16{}\mathrm {i}}{d}+\frac {a^2\,b^6\,16{}\mathrm {i}}{d}}\right )\,\sqrt {\frac {a\,b^2-b^3\,1{}\mathrm {i}}{4\,d^2}}\,2{}\mathrm {i}-\mathrm {atan}\left (\frac {b^6\,\sqrt {\frac {a\,b^2}{4\,d^2}+\frac {b^3\,1{}\mathrm {i}}{4\,d^2}}\,\sqrt {a+b\,\mathrm {cot}\left (c+d\,x\right )}\,32{}\mathrm {i}}{\frac {b^8\,16{}\mathrm {i}}{d}+\frac {a^2\,b^6\,16{}\mathrm {i}}{d}}-\frac {32\,a\,b^5\,\sqrt {\frac {a\,b^2}{4\,d^2}+\frac {b^3\,1{}\mathrm {i}}{4\,d^2}}\,\sqrt {a+b\,\mathrm {cot}\left (c+d\,x\right )}}{\frac {b^8\,16{}\mathrm {i}}{d}+\frac {a^2\,b^6\,16{}\mathrm {i}}{d}}\right )\,\sqrt {\frac {b^3\,1{}\mathrm {i}+a\,b^2}{4\,d^2}}\,2{}\mathrm {i} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(-(a + b*cot(c + d*x))^(1/2)*(a - b*cot(c + d*x)),x)

[Out]

atan((b^6*((a*b^2)/(4*d^2) - (b^3*1i)/(4*d^2))^(1/2)*(a + b*cot(c + d*x))^(1/2)*32i)/((b^8*16i)/d + (a^2*b^6*1
6i)/d) + (32*a*b^5*((a*b^2)/(4*d^2) - (b^3*1i)/(4*d^2))^(1/2)*(a + b*cot(c + d*x))^(1/2))/((b^8*16i)/d + (a^2*
b^6*16i)/d))*((a*b^2 - b^3*1i)/(4*d^2))^(1/2)*2i - atan((b^6*((b^3*1i)/(4*d^2) + (a*b^2)/(4*d^2))^(1/2)*(a + b
*cot(c + d*x))^(1/2)*32i)/((b^8*16i)/d + (a^2*b^6*16i)/d) - (32*a*b^5*((b^3*1i)/(4*d^2) + (a*b^2)/(4*d^2))^(1/
2)*(a + b*cot(c + d*x))^(1/2))/((b^8*16i)/d + (a^2*b^6*16i)/d))*((a*b^2 + b^3*1i)/(4*d^2))^(1/2)*2i - atanh((d
^3*((16*(a^2*b^4 - a^4*b^2)*(a + b*cot(c + d*x))^(1/2))/d^2 + (16*a*b^2*(a^2*b*1i + a^3)*(a + b*cot(c + d*x))^
(1/2))/d^2)*(-(a^2*b*1i + a^3)/d^2)^(1/2))/(16*(a^3*b^5 + a^5*b^3)))*(-(a^2*b*1i + a^3)/d^2)^(1/2) - atanh((d^
3*((a^2*b*1i - a^3)/d^2)^(1/2)*((16*(a^2*b^4 - a^4*b^2)*(a + b*cot(c + d*x))^(1/2))/d^2 - (16*a*b^2*(a^2*b*1i
- a^3)*(a + b*cot(c + d*x))^(1/2))/d^2))/(16*(a^3*b^5 + a^5*b^3)))*((a^2*b*1i - a^3)/d^2)^(1/2) - (2*b*(a + b*
cot(c + d*x))^(1/2))/d

________________________________________________________________________________________